import React, { Component } from 'react'
import LifeCycle from '@/views/LifeCycle'
export default class App extends Component {
  constructor(){
    super()
    this.state={
      isVisable:true
    }
  }
  render() {
    const {isVisable}=this.state
    return (
      <div>
         <button onClick={()=>{
          this.setState({
            isVisable:false
          })
         }}>卸载组件</button>
         {isVisable&&<LifeCycle></LifeCycle>}
      </div>
    )
  }
}
